<?php foreach ($program as $key): ?>
		<div class="ibox float-e-margins">
			<div class="ibox-title" style="border: none;">
				<h5 style="color: #00afef"><i>View</i></h5>
			</div>
			<div class="ibox-content">
				<form class="form-horizontal" id="form-forms-edit">
					<div class="form-group">
						<label class="col-lg-4 control-label">Code</label>
						<input type="hidden" value="<?php echo $key->program_id; ?>" name="pid">
						<div class="col-lg-3">
							<input readonly value="<?php echo $key->program_code; ?>" name="pcode" type="text" class="form-control">
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-4 control-label">Name</label>
						<div class="col-lg-5">
							<input readonly value="<?php echo $key->program_name; ?>" type="text" name="pname" class="form-control">
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-4 control-label">Description</label>
						<div class="col-lg-5">
							<input readonly type="text" value="<?php echo $key->description; ?>" name="desc" class="form-control">
						</div>
					</div>
					<div class="form-group">
                        <label class="col-lg-4 control-label">Program Type</label>
                        <div class="col-lg-5">
                            <select disabled class="form-control m-b" name="pType" id ="prog_type_e">
                                <option value="" id="empty-option">Select Program</option>
                                 <?php foreach($prog_type as $p): ?>
                                <option <?php echo ($key->prog_type == $p->lookup_code ? 'selected' : ''); ?> value="<?php echo $p->lookup_code; ?>"><?php echo $p->meaning; ?></option>
                                <?php endforeach ?>
                            </select>
                        </div>
                    </div>
					<div class="form-group">
						<label class="col-lg-4 control-label">Module</label>
						<div class="col-lg-5">
							<input type="hidden" name="module_id_hidden" value="<?php echo $key->module_id; ?>">
							<select disabled class="form-control m-b" name="modID" id ="module_option_e">
								<option value="" id="empty-option">Select Module</option>
								<?php foreach ($mods as $m) {?>
								<option value ="<?php echo $m->module_id; ?>" <?php echo ($key->module_id == $m->module_id) ? 'selected' : ''; ?>><?php echo $m->module_name; ?></option>
								<?php }
?>
							</select>
						</div>
					</div>
                    <div class="form-group">
                        <label class="col-lg-4 control-label">Module Menu</label>
                        <input type="hidden" id="mod_menu_id_hidden" value="<?php echo $key->group_id; ?>">
                        <div class="col-lg-5">
                            <select disabled class="form-control m-b" name="ppGroup" id ="module_menu_option_e">
                                <option value="" id="empty-option">Select Module Menu</option>
                            </select>
                        </div>
                    </div>
					<div class="form-group">
						<label class="col-lg-4 control-label">Executable Filename</label>
						<div class="col-lg-5">
							<input readonly type="text" name="exename" value="<?php echo $key->exe_file_name; ?>" class="form-control">
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-4 control-label">Enable</label>
						<div class="col-lg-1">
							<input disabled <?php echo ($key->enable_flag == 'Y' ? 'checked' : ''); ?> type="checkbox" class="i-checks" value="ok" name="enabled">
						</div>
					</div>
					</form>
				</div>
                <div class="ibox-content">
                    <table class="table dataTables table-bordered">
                        <thead>
                            <tr>
                                <th>Seq. No.</th>
                                <th>Name</th>
                                <th>Description</th>
                                <th>Data Type</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach($params as $p): ?>
                                <tr>
                                    <td align='right'><?php echo $p->seq_no; ?></td>
                                    <td><?php echo $p->name; ?></td>
                                    <td><?php echo $p->desc; ?></td>
                                    <td><?php echo $p->data_type; ?></td>
                                </tr>
                            <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
			</div>
		</div>
	</div>
	<?php endforeach;?>
	<script type="text/javascript">
	$(document).ready(function() {
		$('select').chosen({width: '100%'});
		$.ajax({
	        type: "POST",
	        url: "<?php echo base_url($this->session->userdata('forajax') . '/searchmodmenu'); ?>",
	        data: { "mod_menu_id" :  $('#module_option_e').val() },
	        dataType: 'json',
	        success: function(e){
	           console.log(e);
                var tmp = "";
                var id = $('#mod_menu_id_hidden').val();
                $.each(e, function(i, item) {
                	var selected = '';
                	if(e[i].menu_id == id){
                		selected = "selected";
                	}
                    tmp += "<option value='"+e[i].menu_id+"' "+selected+">"+e[i].menu_name+"</option>";
                });
                tmp = tmp + "<option value='-1'>None</option>";
                 $('#module_menu_option_e').html(tmp);
                 $('select').trigger('chosen:updated');
	        }
        });

		$('.i-checks').iCheck({
	        checkboxClass: 'icheckbox_square-green',
	        radioClass: 'iradio_square-green'
	    });
	});
	</script>
